In recent years, an electronic device such as a smartphone or a tablet is provided with, for example, a proximity sensor which is used for detecting approach of a face of a user and automatically turning off a power supply of a display. Also, an autofocus system in a camera or an automatic robot such as a robot cleaner is provided with a distance measurement sensor used for distance or position detection.
A proximity sensor is an optical sensor for detecting an object to be detected at a short distance and in general, a photodiode which performs a detection determination with an optical current generated by receiving light is used as a light receiving element. In the distance measurement sensor, SPAD is generally used, is an optical sensor for detecting an object to be detected at a distance farther than the proximity sensor, The SPAD is a kind of photodiode used in a state where avalanche breakdown occurs by applying a voltage equal to or higher than a breakdown voltage, and is characterized by having a high amplification factor of 10,000 to 1,000,000 times for incident photocarriers and high sensitivity enough to detect a single photon. For that reason, it is possible to perform minute light detection in which light of the light emitting element which is reflected from the object to be detected at a long distance and returned is detected, and it is possible to detect the object to be detected which is 1 m or more away. Common to these devices is a point that these devices have a light emitting element and a light receiving element and detect the reflected light from the object to be detected to detect presence or absence or the distance of the object to be detected.
Examples of such a photosensor include one described in PTL 1. The photosensor of PTL 1 includes a light emitting element and a light receiving element, and a diffraction grating is provided on a path of light radiated from the light emitting element, reflected by a light-transmitting plate, and directed toward the light receiving element so that intensity of light directed toward the light receiving element without being reflected by the object to be detected, among the light radiated from the light emitting element, is reduced.